package test;

import java.util.Scanner;

/**
 * @author chihb
 * @create-time 2024/6/19 22:03
 * @description
 */
public class BuyTicket {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        System.out.println("现在的月份是");
        int result= s.nextInt();
        System.out.println("头等舱还是经济舱");
        String choose=s.next();
        Double money;
        if(result>=5&&result<=10){
            money=getSummerMoney(choose);
        }else {
            money=getCleanMoney(choose);
        }
        System.out.println(money);
    }
    private static Double getSummerMoney(String s){
        return switch (s) {
            case "头等舱" -> 0.9;
            case "经济舱" -> 8.5;
            default -> null;
        };
    }
    private static Double getCleanMoney(String s){
        return switch (s) {
            case "头等舱" -> 0.7;
            case "经济舱" -> 6.5;
            default -> null;
        };
    }
}
